Returning 2d array using pointer to an array in c